USE [DSRSystem]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[spGetGovernanceFinalizedCompanies]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[spGetGovernanceFinalizedCompanies]
GO


CREATE PROCEDURE [dbo].[spGetGovernanceFinalizedCompanies]
@ChangedSince datetime
AS
BEGIN
	DECLARE @transaction_isolation_level SMALLINT;
	
	SELECT @transaction_isolation_level = transaction_isolation_level
    FROM sys.dm_exec_requests
    WHERE session_id = @@spid;
	
	print('spGetGovernanceFinalizedCompanies transaction_isolation_level: ' + STR(@transaction_isolation_level))

	select CompanyId,
		   Name as CompanyName,
		   CIQID as CapitalIQID,
		   LastFinalUpdate,
		   LastCentralizedResearchUpdate
	from Companies 
    where IsParked = 0 and WorkingVersion > 1002
END
GO


